{extends file='layout/main.html'}
{block name="main"}
<div class="main_title">
	<h2>添加内容</h2>
</div>
<form action="?url=resource/create" method="post" accept-charset="utf-8" enctype="multipart/form-data">
	<input type="hidden" name="mid" value="{$mid}">

{foreach $attribute as $val}
	{if $val.type==input}
		<div class="con_blk">
		  <h3 class="light_gray">{$val.name}</h3>
			<input type="text" name="attribute[{$val.name}]" class="text"/>
			{if $val.is_unique}
				（*唯一）
			{/if}
		</div>
	{elseif $val.type=='text'}
	<div class="con_blk">
		<h3 class="light_gray">{$val.name} 
				{if $val.is_unique}
					<span>（*唯一）</span>
				{/if}
		</h3>
		<textarea name="attribute[{$val.name}]" cols="" rows="6"></textarea>
	</div>
	{elseif $val.type=='file'}
	<div class="con_blk">
	  <h3 class="light_gray">{$val.name}
	  	{if $val.is_unique}
	  		<span>（*唯一）</span>
	  	{/if}
	  </h3>
	  {include file="lib/btn_upload.html" att_id=$val.name}
	</div>
	{elseif $val.type=='checkbox'}
		<div class="clearfix">
			<dl class="set_blk">
				<dt class="light_gray">{$val.name}</dt>
				{foreach $val.value as $v}
			    <dd><input type="checkbox" name="attribute[{$val.name}][]" value="{$v}"> {$v}</dd>
			  {/foreach}
			</dl>
			{if $val.is_unique}
				（*唯一）
			{/if}
		</div>
	{elseif $val.type=='select'}
		<div class="clearfix">
			<dl class="set_blk">
				<dt class="light_gray">{$val.name}</dt>
				<dd>
		      <select name="attribute[{$val.name}]">
					  {foreach $val.value as $v}
					    <option value="{$v}">{$v}</option>
					  {/foreach}
					</select>
				</dd>
			</dl>
			{if $val.is_unique}
				（*唯一）
			{/if}
		</div>
	{elseif $val.type=='password'}
		<div class="con_blk">
		  <h3 class="light_gray">{$val.name}</h3>
			<input type="password" name="attribute[{$val.name}]" class="text"/>
			{if $val.is_unique}
				（*唯一）
			{/if}
		</div>
	{elseif $val.type=='date'}
		<div class="con_blk">
		  <h3 class="light_gray">{$val.name}
		  	{if $val.is_unique}
		  		<span>（*唯一）</span>
		  	{/if}
		  </h3>
			<input type="text" name="attribute[{$val.name}]" class="text datepicker"/>
		</div>
	{elseif $val.type=='model'}
		<div class="clearfix">
			<dl class="set_blk">
				<dt class="light_gray">{$val.name}</dt>
				<dd>
		      <select name="attribute[{$val.name}]">
					  {foreach $val.value as $v}
					    <option value="{$v@key}">{$v}</option>
					  {/foreach}
					</select>
				</dd>
			</dl>
			{if $val.is_unique}
				（*唯一）
			{/if}
		</div>
	{/if}
{/foreach}

</form>

<div class="btn_blk b_t">
	<div class="fr">
		<a href="#" class="btn2 fr ml20 cancel">取消</a>
		<a href="#" class="btn1 fr save">确定</a>
	</div>
</div>
<script type="text/javascript" src="../Library/3rd/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js/tinyMCE.config.js"></script>
{/block}